// pages/all_plan_notice/all_plan_notice.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    page:0,
    pagesize:10,
    list:[],
    type:0,
    tablist:["全部","随访计划提醒","信息审核通知","消息提醒"],
    tabIndex:0,
    // list:[
    //   {title:'信息审核通知',src:'/images/tz_sh.png'},
    //   {title:'消息提醒',src:'/images/tz_xx.png'},
    //   {title:'随访计划提醒',src:'/images/tz_tx.png'},
    // ]
  },
  // tab切换
  bindtab(e){
    this.setData({
      tabIndex:e.target.dataset.index,
      type:e.target.dataset.index,
      page:0,
      list:[],
    })
    this.getMessage();
  },
  // 私人定制详情
  binddetail(e){
    // wx.navigateTo({
    //   url: '/pages/private_services/private_services',
    // })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.getMessage();
  },
  getMessage:function(){
    var that = this;
    app.util.request({
      'url':"entry/wxapp/follow.message_list",
      data:{
        openid:wx.getStorageSync('openid'),
        type:that.data.type,
        pagesize:that.data.pagesize,
        page:that.data.page
      },
      success:function(res)
      {
        that.setData({
          list:that.data.list.concat(res.data),
          page:that.data.page + 1
        })
      }
    })
  },
  
})